package com.yanqu.road.entity.enums;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public enum eUnionActivityGroupType {

    // 大航海
    HangHai(eActivityType.HangHaiActivity.getValue(), false, false, false),

    // 群英
    CrossUnionWar(eActivityType.CrossUnionWarActivity.getValue(), true, true, true),

    // 商会经验
    CrossUnionExp(eActivityType.CrossUnionActivity.getValue(), false, false, false),
    // 海上争霸
    Seacraft(eActivityType.SeacraftActivity.getValue(), false, false, false),

    // 统兵演武
    TongBing(eActivityType.TongBingActivity.getValue(), true, true, false),
    // 据点战
    CrossStrongHold(eActivityType.StrongholdWarActivity.getValue(), false, false, false),

    // 盐场
    CrossOreWar(eActivityType.OreWarActivity.getValue(), false, false, false),

    // 五熊争霸
    FiveHero(eActivityType.FiveHero.getValue(), true, true, false),

    // 商会商战
    CrossTradeWar(eActivityType.CrossTradeWarActivity.getValue(), true, false, false),

    //琅琊榜
    LangYaBang(eActivityType.LangYaBang.getValue(),false,false, false),
    // 商会经验
    DaFuWeng(eActivityType.DaFuWeng.getValue(), false, false, false),

    // 皇陵
    Tomb(eActivityType.Tomb.getValue(), false, false, false),

    Twins(eActivityType.Twins.getValue(), false, false, false),

    //巅峰海战
    PeakSeacraft(eActivityType.PeakSeacraftActivity.getValue(), true, true, false),

    //巅峰据点战
    PeakStrongHold(eActivityType.PeakStrongHold.getValue(), true, true, false),

    //第一镖局
    BiaoJu(eActivityType.BiaoJu.getValue(), false, false, true),

    // 逐鹿隋唐
    SuiTang(eActivityType.SuiTang.getValue(), true, true, true),

    //山海伏兽
    SonHai(eActivityType.SonHai.getValue(), false, false, true),

    // 海神岛
    HsIsland(eActivityType.HsIsland.getValue(), true, true, true),

    //斗罗
    DouLuo(eActivityType.DouLuoDaLuActivity.getValue(), false, false, true),

    // 敦煌石窟
    DunHuang(eActivityType.CrossDunHuangShiKuActivity.getValue(), false, false, true),

    //小马快跑
    HorseRun(eActivityType.HorseRun.getValue(), false, false, true),

    // 楚汉争霸
    ChuHan(eActivityType.ChuHanZB.getValue(), true, true, true),

    //行游山水
    XingYouShanShui(eActivityType.XingYouShanShui.getValue(), false, false, true),
    ;

    private int activityType;
    private boolean limitUnionNum;
    private boolean appointGroupTime;
    private boolean lockMember;

    private static final Map<Integer, eUnionActivityGroupType> cache = new ConcurrentHashMap<>();

    static {
        for (eUnionActivityGroupType type : eUnionActivityGroupType.values()) {
            cache.put(type.getActivityType(), type);
        }
    }

    eUnionActivityGroupType(int activityType, boolean limitUnionNum, boolean appointGroupTime, boolean lockMember) {
        this.activityType = activityType;
        this.limitUnionNum = limitUnionNum;
        this.appointGroupTime = appointGroupTime;
        this.lockMember = lockMember;
    }

    public int getActivityType() {
        return activityType;
    }

    public void setActivityType(int activityType) {
        this.activityType = activityType;
    }

    public boolean isLimitUnionNum() {
        return limitUnionNum;
    }

    public void setLimitUnionNum(boolean limitUnionNum) {
        this.limitUnionNum = limitUnionNum;
    }

    public boolean isAppointGroupTime() {
        return appointGroupTime;
    }

    public void setAppointGroupTime(boolean appointGroupTime) {
        this.appointGroupTime = appointGroupTime;
    }

    public boolean isLockMember() {
        return lockMember;
    }

    // -----------------------------

    public static eUnionActivityGroupType getType(int activityType) {
        return cache.get(activityType);
    }

}
